package models

import "github.com/zw2582/ginlib"

type Product struct {
	Id          int64 `xorm:"pk autoincr"`
	Name        string
	Sku         string `xorm:"varchar(32) unique"`
	Price       float64
	Description string
}

func init() {
	ginlib.XormAddWaitSync(new(Product))
}

func ProductGetById(id int64) (obj Product, err error) {
	_, err = DB.ID(id).Get(&obj)
	return
}